<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/9/26
 * Time: 9:30
 */


class Foo {
    public static function doAwesomeThings() {
        FunctionCaller::callIt(self::class . '::someAwesomeMethod');
    }

    public static function someAwesomeMethod() {
        // fantastic code goes here.
        echo 'someAwesomeMethod';
    }
}

class FunctionCaller {
    public static function callIt(callable $func) {
        call_user_func($func);
    }
}

Foo::doAwesomeThings();

echo 'You can also have embedded newlines in 
strings this way as it is
what are you talk about?
okay to do';
$a = <<<EOT
<br>
what are you talking about?
EOT;

$a = <<<EOD
what <br>{$a}<br> are you talking about?
EOD;
echo $a;

echo "<hr>";
$a[1] = 'man';
$arr[] = 'man';
echo $a[1];
echo "<br>";
$b['man'] = "player";
$aa = $a;
echo $aa; // will result in error
echo $b['man']; // will result in error
echo $b[($arr[0])]; // will result in error

echo "<br>";

echo "     \n\v\f    \r   1234" + 1;    // 1235
var_export ("\v\f    \r   1234" == "1234");    // true

$x = "0123"  + 100;
$y = 0123 + 0;

echo "<br>";
echo $x;
echo "<br>";
echo $y;

echo "<br>";
$xml = simplexml_load_file('test.xml');
var_dump($xml);
echo "<br>";
var_dump($xml->root);
echo "<br>";
echo $xml->root->{'element-one'};
$foo = function (){
    echo __FILE__;
    echo "<br>";
    echo __DIR__;
    echo "<br>";
    echo __LINE__;
    echo "<br>";;
    return __FUNCTION__;
};
$test = $foo();
echo $foo();
//foo(<<<EOD
//hehe
//EOD
//);

